package com.itheima.dao;

import com.itheima.pojo.Member;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface MemberDao {

    @Select("select * from t_member where phoneNumber=#{phoneNumber}")
    public Member findMemberByTelephone(@Param("phoneNumber") String telephone);

    @Insert("insert into t_member values(null,#{fileNumber},#{name},#{sex},#{idCard},#{phoneNumber},#{regTime},#{password},#{email},#{birthday},#{remark})")
    @Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
    public void addMember(Member member);

    @Update("update t_member set " +
            "fileNumber=#{fileNumber},name=#{name},sex=#{sex},idCard=#{idCard},phoneNumber=#{phoneNumber},regTime=#{regTime},password=#{password},email=#{email},birthday=#{birthday},remark=#{remark} where id=#{id}")
    public void updateMember(Member member);


}
